package com.markby.fscm.utils;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @program: soft-server-cipher-machine
 * @description: 格式化时间
 * @author: baoyu
 * @create: 2024-08-11 11:24
 **/
public class DateFormatUtils {

    public static String formatDate(Date date) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        return sdf.format(date);
    }

    public static String formatDate(Date date,String pattern) {
        SimpleDateFormat sdf = new SimpleDateFormat(pattern);
        return sdf.format(date);
    }
}
